/**
 * Created by kangli on 2018/4/23.
 */
$(function(){
    var schoolDynamicsId = getQueryString("schoolDynamicsId");
    var  data={schoolDynamicsId: schoolDynamicsId};
    AjaxSubmit("GET",data, basePath + "/super/common/examine/getSchoolDynamicsById",getSchoolDynamicsById_fun);
    function getSchoolDynamicsById_fun(res){
        console.log(res);
        if(res.status=='SUCCESS'){
            var title = res.obj.title || '';
            var brief = res.obj.brief || '';
            var pic='';
            var content = res.obj.content || '';
            var time = res.obj.creatTime ||'';
            if(res.obj.pic!=null&&res.obj.pic!=undefined&&res.obj.pic!=""){
                pic = '<img src="'+res.obj.pic+'">';
            }else{
                pic='<p style="line-height: 30px">无</p>'
            }
            $("#title").val(title);
            $("#brief").val(brief);
            $("#createtime").text(time);
            $("#content").val(content)
            $("#pic").append(pic);
        }

    }
})

function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var ifream = window.parent.document.getElementById("myframe");
    var r = ifream == null ? window.location.search.substr(1).match(reg)
        : ifream.contentWindow.location.search.substr(1).match(reg);
    if (r != null)
        return unescape(r[2]);
    return null;
}